//
//  KXActionSheet.h
//  DD
//
//  Created by HaiJiao Chen on 12-8-23.
//  Copyright (c) 2012年 Kaixin. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void (^actionSheetBlock)(id p1, id p2, id p3);

@interface KXActionSheet : NSObject<UIActionSheetDelegate>
{
    UIActionSheet* actionSheet;
    NSMutableDictionary* codes;
    NSMutableDictionary* params;
}
@property(nonatomic, retain) id p1;
@property(nonatomic, retain) id p2;
@property(nonatomic) NSInteger cancelButtonIndex;
@property(nonatomic) NSInteger destructiveButtonIndex;
@property(nonatomic, copy) NSString *title;

- (id)init;
- (id)initWithTitle:(NSString *)title
  cancelButtonTitle:(NSString *)cancelButtonTitle cancelCode:(actionSheetBlock)cancelCode cancelParam:(id)cancelParam
destructiveButtonTitle:(NSString *)destructiveButtonTitle destructiveCode:(actionSheetBlock)destructiveCode destructiveParam:(id)destructiveParam
    otherButtonTitles:(NSString *)otherButtonTitles, ...;

- (NSInteger)addButtonWithTitle:(NSString *)title code:(actionSheetBlock)code param:(id)param;
- (void)showInView:(UIView *)view;

- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated;
@end
